package com.friday.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.jms.Session;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.friday.bo.PersonnelBo;
import com.friday.bo.impl.PersonnelBoImpl;
import com.friday.po.Employee;

public class GetAllEmployeesServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		PersonnelBo personnel = new PersonnelBoImpl();
		HttpSession session = request.getSession();
		try {
			List<Employee> emps = personnel.getAllEmployee();
			session.setAttribute("employees", emps);
			response.sendRedirect("All_staff_Adjustment.jsp");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
